package org.example.app.controller;

import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.extern.slf4j.Slf4j;
import org.example.system.entity.AssignedEntity;
import org.example.system.service.AssignedService;
import org.example.system.vo.AssignedVo;
import org.example.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 排课控制层
 */
@RestController
@RequestMapping("/app/assigned")
@Slf4j
public class AssignedController {

    @Autowired
    private AssignedService assignedService;

    /**
     * 按条件分页查询
     * @param assigned
     * @return
     */
    @GetMapping("/list")
    public R list(AssignedEntity assigned) {
        log.info("------------AssignedController | list | input : {} ", JSON.toJSONString(assigned));
        IPage<AssignedEntity> page = assignedService.selectPage(assigned);
        log.info("------------AssignedController | list | return : {} ", JSON.toJSONString(page));
        return R.ok(page);
    }
}
